enum Enum {
    UP = "UP",
    DOWN = "DOWN",
    LEFT = "LEFT",
    RIGHT = "RIGHT"
}

function directionFun(direction: Enum): void {
    switch (direction) {
        case Enum.LEFT:
            console.log("往左走")
            break;
        case Enum.RIGHT:
            console.log("往右走")
            break;
        case Enum.UP:
            console.log("往上走")
            break;
        case Enum.DOWN:
            console.log("往下走")
            break;
    }
}
directionFun(Enum.DOWN)
directionFun(Enum.LEFT)
directionFun(Enum.RIGHT)
directionFun(Enum.UP)
